<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>数据统计页面</title>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/lib/layui/css/layui.css">
</head>
<body>
    <div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
				<table id="financeTable" lay-filter="financeTable"></table>
				<div >
					<center>
					总车次:1231    总重量:123123
					</center>
				</div>
			</div>
		</div>
	</div>
</body>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/lib/layui/layui.all.js"></script>
<script>
var ctx = "${pageContext.request.contextPath}";
var areaDicDatas = eval('${areaDicDatas}');
function getDicVal(value,list){
	for(var i=0;i<list.length;i++){
		if(list[i].dicDataValue==value){
			return list[i].dicDataName;
		}
	}
	return "";
}
$(function(){
	var laydate = layui.laydate;
	  
	//执行一个laydate实例
	laydate.render({
		elem: '#enteringDate', //指定元素
		format: 'yyyyMMdd' //可任意组合
	});
	
	var laytable = layui.table;
	
	function zs(){
		var tableIns = laytable.render({
		    elem: '#financeTable'
		    ,url: ctx+'/dataAnalyze/findTotal' //数据接口
		    ,height:350
		    ,where: {
		    	areaId: $("#areaId").val(), 
		    	addDate: $("#addDate").val(),
		    	invoiceType:$("#invoiceType").val()	    	
		    }//参数
		    ,page: true //开启分页
		    ,cols: [[ //表头
		      {field: 'areaId', title: '所属区域',templet: function(d){
		          return getDicVal(d.areaId,areaDicDatas);
		      }  }
		      ,{field: 'carTims', title: '车次'} 
		      ,{field: 'weights', title: '重量',templet: function(d){
		          return d.weights;
		      } }
		    ]]
		  });
		}
	
	zs();
	window.setInterval("zs()",60000); 

});


</script>
</html>